/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 苏李涛
 * Date: 2024-05-01
 * Time: 12:58
 */
class Dog {
    public String name; //属性
    public String color;
    public int age;

    //行为
    public void wag() { //public修饰的类和文件名相同，而不可以随意修改
        System.out.println(name + "年龄" + age + " " + color + "摇尾巴");
    }
}

public class Main {
    public static void main(String[] args) {
        Dog dog = new Dog();//实例化对象1
        dog.name = "小灰";
        dog.color = "灰色";
        dog.age = 10;
        dog.wag();


        Dog dog1 = new Dog();
        dog1.name = "小黑";
        dog1.age = 12;
        dog1.color = "黑色";
        dog1.wag();
        /**
         * 一个类可以实例化多个对象
         */
    }
}
